package com.example.android.viper;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

public class Home extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		//Log.d("ViperView", "Entra In Home");
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.home);
	}
	/*@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_home, menu);
		return true;
	}*/
	
	/*******************************
	To reach the click on the menu*/ 
	public void onBtnClicked(View v){
		/************************
		 This is for the 'Start'*/
	    if(v.getId() == R.id.textPlay){
	    	Log.d("ViperView", "EntraInStart");
	    	//start a new activity
            Intent new_activity = new Intent(Home.this, Viper.class);                               
            startActivity(new_activity);
	    }
	    /************************
		 This is for the 'Options'*/
	    else if (v.getId() == R.id.textOptions){
	    	Log.d("ViperView", "EntraInOptions");
	    	//start a new activity
            Intent new_activity = new Intent(Home.this, Options.class);                                   
            startActivity(new_activity); 
           
	    }
	    else if (v.getId() == R.id.textInstructions){
	    	Log.d("ViperView", "EntraInInstructions");
	    	//start a new activity
            Intent new_activity = new Intent(Home.this, Instructions.class);                                   
            startActivity(new_activity); 
           
	    }
	    else if (v.getId() == R.id.textExit){
	    	Log.d("ViperView", "Chiude l'app");
	    	//This will close the app, showing the phone idle screen
           	Intent intent = new Intent(Intent.ACTION_MAIN);
	    	intent.addCategory(Intent.CATEGORY_HOME);
	    	intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
	    	startActivity(intent);
           
	    }
	}

}
